import { post, get } from '@/utils/request/index';
import ApiUrl from '@/api/url';

/**
 * 获取期间
 */
export const getDsPeriodList = async () => {
  const res: any = ((await get(ApiUrl.getDsPeriodList, {})) as any).data;
  return res.data || [];
};

/**
 * 获取银行账户信息下拉列表
 */
export const getBankAccountInfoList = async (parms: any) => {
  const res: any = ((await post(ApiUrl.getBankAccountInfoList, parms)) as any).data;
  return res;
};

/**
 * 获取对账责任人下拉列表
 */
export const getReconciliationManagers = async (parms: any) => {
  const res: any = (((await get(ApiUrl.getReconciliationManagers, parms)) as any) || {}).data;
  return (res || {}).data || [];
};

/**
 * 获取对账责任人下拉列表
 */
export const getValueByKey = async (prams) => {
  const res: any = ((await post(ApiUrl.getValueByKey, prams)) as any).data;
  return res.data || [];
};

/**
 * 获取任务类型下拉列表
 */
export const getSelectTaskTypeNew = async (parms: any) => {
  const res: any = ((await post(ApiUrl.getSelectTaskTypeNew, parms)) as any).data;
  return res.data || [];
};

// 获取ou下拉列表
export const getOrgIdList = async (parms: any) => {
  const res: any = ((await post(ApiUrl.getOrgIdList, parms)) as any).data;
  return res.data || [];
};

// 获取海外ou下拉列表
export const getOverseasOuList = async (parms: any) => {
  const res: any = ((await post(ApiUrl.getOverseasOuList, parms)) as any).data;
  return res.data || [];
};

// 获取提交人列表
export const getTaskCreateByList = async (parms: any) => {
  const res: any = ((await post(ApiUrl.getTaskCreateByList, parms)) as any).data;
  return res.data || [];
};

// 获取银行
export const getBankNameList = async (parms: any) => {
  const res: any = ((await get(ApiUrl.getBankNameList, parms)) as any).data;
  return res.data || [];
};

// 获取币种
export const getCurrency = async (parms: any) => {
  const res: any = ((await post(ApiUrl.getCurrency, parms)) as any).data;
  return res.data || [];
};

// 获取银行账号下拉列表
export const getAccountinfoList = async (parms: any) => {
  const res: any = ((await post(ApiUrl.getAccountinfoList, parms)) as any).data;
  return res.data || [];
};
